

b=["pig","cow","cock","hen","goat","dog","pig"]
l=len(b)
print("长度是 ",l)
print(b[5])
b[5]="老狗"
print(b)
h=b[2:4]
print(h)
c=["沈嘉南","王城宇",["老张","老张老婆","老张小孩小张"]]
print(c[2][2])
print("&"*18)
#b+="horse"
b.append("horse")

print(b)
b.insert(3,"duck")
print(b)
#遍历 list
for x in b:
    print(x,end='\t')
print()
for x in range(0,len(b)):
    print(b[x],end='\t')
print()
